package cn.k.controller;

import cn.k.domain.ConsumptionItem;
import cn.k.qo.JSONResult;
import cn.k.qo.QueryObject;
import cn.k.service.IConsumptionItemService;
import cn.k.util.RequirePermission;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("/consumptionItem")
public class ConsumptionItemController {

    @Autowired
    private IConsumptionItemService consumptionItemService;





    //处理添加或者更新的请求
    @RequirePermission(name ="结算单明细编辑",expression = "consumptionItem:saveOrUpdate")
    @RequestMapping("/saveOrUpdate")
    @ResponseBody
    public JSONResult saveOrUpdate(ConsumptionItem consumptionItem){
        consumptionItemService.insert(consumptionItem);
        return new JSONResult(true,"添加成功");
    }


}
